<div class="layuimini-container">
    <link rel="stylesheet" href="__STATIC__/admin/css/order.css?v={$version}" media="all">
    <form id="app-form" class="layui-form layuimini-form layui-form-pane">

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>订单信息</legend>
        </fieldset>
        <input  type="hidden" name="id"  value="{$row.id|default=''}">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">订单编号</label>
                <div class="layui-input-inline">
                    <input readonly type="text" name="trade_no" class="layui-input" placeholder="请输入订单编号" value="{$row.trade_no|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">支付时间</label>
                <div class="layui-input-inline">
                    <input type="text" data-date="" data-date-type="datetime" name="pay_time" class="layui-input" placeholder="请输入支付时间" value="{$row.pay_time|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">发货时间</label>
                <div class="layui-input-inline">
                    <input type="text" data-date="" data-date-type="datetime" name="consign_time" class="layui-input" placeholder="请输入发货时间" value="{$row.consign_time|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">派送时间</label>
                <div class="layui-input-inline">
                    <input type="text" data-date="" data-date-type="datetime" name="to_deliver_time" class="layui-input" placeholder="请输入派送时间" value="{$row.to_deliver_time|default=''}">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">物流单号</label>
                <div class="layui-input-inline">
                    <input type="text" name="logistics_no" class="layui-input" placeholder="请输入物流单号" value="{$row.logistics_no|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">应收</label>
                <div class="layui-input-inline">
                    <input type="number" name="receivable" class="layui-input" placeholder="请输入应收" value="{$row.receivable|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">店铺名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="shop_name" class="layui-input" placeholder="请输入店铺名称" value="{$row.shop_name|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">收件人地址</label>
                <div class="layui-input-inline">
                    <input type="text" name="receiver_address" class="layui-input" placeholder="请输入收件人地址" value="{$row.receiver_address|default=''}">
                </div>
            </div>
        </div>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>商品信息</legend>
        </fieldset>


        <script id="goods_tpl" type="text/html">

            {{#  layui.each(d.list, function(index, item){ }}
            <fieldset class="layui-elem-field">
                <legend>
                    <button data-index="{{index}}" type="button" class="btn-del layui-btn layui-btn-normal layui-btn-danger">删除</button>
                </legend>

                <div class="layui-field-box">

                    <input type="hidden" name="goods[{{index}}][order_id]" class="layui-input" placeholder="请输入商品名称"
                           value="{{ item.order_id??''}}">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">商品名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="goods[{{index}}][goods_name]" class="layui-input" placeholder="请输入商品名称"
                                       value="{{ item.goods_name??''}}">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">规格编码</label>
                            <div class="layui-input-inline">
                                <input type="text" name="goods[{{index}}][spec_no]" class="layui-input" placeholder="请输入规格编码"
                                       value="{{item.spec_no??''}}">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">数量</label>
                            <div class="layui-input-inline">
                                <input type="number" name="goods[{{index}}][num]" class="layui-input" placeholder="请输入数量" value="{{item.num??''}}">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">商品单价</label>
                            <div class="layui-input-inline">
                                <input type="number" name="goods[{{index}}][price]" class="layui-input" placeholder="请输入商品单价"
                                       value="{{item.price??''}}">
                            </div>
                        </div>

                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">条形码</label>
                            <div class="layui-input-inline">
                                <input type="text" name="goods[{{index}}][barcode]" class="layui-input" placeholder="请输入条形码"
                                       value="{{item.barcode??''}}">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">反馈产品数量</label>
                            <div class="layui-input-inline">
                                <input type="text" name="goods[{{index}}][feedback_num]" class="layui-input" placeholder="请输入反馈产品数量"
                                       value="{{item.feedback_num??''}}">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">供应商名称</label>
                            <div class="layui-input-inline">
                                <select name="goods[{{index}}][supplier_name]" data-select="{:url('dict.data/index')}?pid=5" data-fields="value,title"
                                        data-value="{{item.supplier_name??''}}">
                                </select>

                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">供应商价格</label>
                            <div class="layui-input-inline">
                                <input type="number" name="goods[{{index}}][supplier_price]" class="layui-input" placeholder="请输入供应商价格"
                                       value="{{item.supplier_price??''}}">
                            </div>
                        </div>

                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">质量问题类型</label>
                        <div class="layui-input-inline">
                            <select name="goods[{{index}}][quality_problem]" data-select="{:url('dict.data/index')}?pid=4" data-fields="value,title"
                                    data-value="{{item.quality_problem??''}}">
                            </select>
                        </div>
                    </div>
                </div>

            </fieldset>

            {{#  });  }}



        </script>


        <div id="view"></div>
        <div class="layui-form-item ">
            <div class="layui-input-block">
                <button type="button" class="btn-add layui-btn layui-btn-normal layui-btn-success">新增商品</button>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>赔付信息</legend>
        </fieldset>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">商家赔付</label>
                <div class="layui-input-inline">
                    <input type="text" name="store_indemnity" class="layui-input" placeholder="请输入商家赔付" value="{$row.store_indemnity|default=''}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">供应商赔付</label>
                <div class="layui-input-inline">
                    <input type="text" name="supplier_indemnity" class="layui-input" placeholder="请输入供应商赔付" value="{$row.supplier_indemnity|default=''}">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">打款方式</label>
                <div class="layui-input-inline">
                    <select name="payment_method" data-select="{:url('dict.data/index')}?pid=2" data-fields="value,title"
                            data-value="{$row.payment_method|default=''}">
                    </select>

                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">订单备注</label>
            <div class="layui-input-block">
                <input type="text" name="order_remark" class="layui-input" placeholder="请输入订单备注" value="{$row.order_remark|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">客服备注</label>
            <div class="layui-input-block">
                <input type="text" name="cs_remark" class="layui-input" placeholder="请输入客服备注" value="{$row.cs_remark|default=''}">
            </div>
        </div>


        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>其他信息</legend>
        </fieldset>
        <div class="layui-form-item">
            <label class="layui-form-label">处理人</label>
            <div class="layui-input-block">
                <input type="text" name="handler" class="layui-input" placeholder="请输入处理人" value="{$row.handler|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单处理状态</label>
            <div class="layui-input-block">
                {foreach $getMerchantStatusList as $k=>$v}
                <input type="radio" name="merchant_status" value="{$k}" title="{$v}" {in name="k" value="$row.merchant_status" }checked="" {/in}>
                {/foreach}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">平台名称</label>
            <div class="layui-input-block">


                <input  readonly class="layui-input" placeholder="请输入平台名称" value="{$row.platform_id|default=''}">
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>图片凭证</legend>
        </fieldset>
        <input id="input_images" type="hidden" class="layui-input layui-col-xs6" value="{$row.images|default=''}">
        <div style="display: flex;align-content: center">

            <div class="layui-upload-drag" style="height: 142px" id="test10">
                <i class="layui-icon"></i>
                <p>点击上传，或将文件拖拽到此处</p>

            </div>
            <blockquote class="layui-elem-quote layui-quote-nm" style="margin: 0px 0 0 10px;flex: 1">
                预览图：
                <div id="upload_view" class="layui-upload-list" style="display: flex;flex-wrap: wrap">

                </div>

                <script id="upload_tpl" type="text/html">

                    {{#  layui.each(d, function(index, item){ }}
                    <div class="upload-img-item-wrap">
                        <div data-index="{{index}}" class="upload-img-item-del-btn">

                            <i style="" class="fa fa-close"></i>
                        </div>
                        <img
                                data-image
                                data-content="{{item}}"
                                src="{{item}}"
                                class="layui-upload-img">
                    </div>
                    {{#  });  }}
                </script>
            </blockquote>
        </div>


        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>
